 

/**  0       1       2       3
 *0  road    ps      link    nuker
 *1  road    t       w       factory
 *2  road    road    s       road
 *
 *
*/
export class  CoreLayout
{
    public _WorkPos:IFVector2={x:2,y:1};
    public _factorypos:IFVector2={x:3,y:1};
    public _nukerpos:IFVector2={x:3,y:0};
    public _linkpos:IFVector2={x:2,y:0};
    public _terminalpos:IFVector2={x:1,y:1};
    public _storepos:IFVector2={x:2,y:2};
    public _powerSpawnpos:IFVector2={x:1,y:0};

    public formatVector(p:IFVector2)
    {
        return `${p.x}/${p.y}`
    }
    public parseVector(str:string):IFVector2
    {
        const arr = str.split('/');
        if(arr.length!==2)
        {
            throw new Error(`解析错误:${str}`);
        }
        return {x:parseInt(arr[0]),y:parseInt(arr[1])}
    }
 
}
 

export const CoreLayoutConfig=new CoreLayout();